package com.itheima.string;



public class StringDemo3 {
    public static void main(String[] args) {
        //字符串里面的对象是不可变的，每次赋值的新的字符串都是创建了一个新的对象地址
        String s1 = "abc";
        s1 += "def";
        s1 += "ghi";
        System.out.println(s1);

        //
        String s2 = "abc";
        String s3 = "abc";
        System.out.println(s2 == s3);

        char[] chars = {'a','b','c'};
        String a1 = new String(chars);
        String a2 = new String(chars);
        System.out.println(a1 == a2);
    }


}
